<template>
  <el-row :gutter="20" class="panel-group" type="flex" justify="space-between">
    <!-- <el-col :xs="6" :sm="6" :md="6" :lg="6" :xl="6" class="card-panel-col"></el-col> -->
    <el-col :xs="6" :sm="6" :md="6" :lg="6" :xl="9" class="card-panel-col">
      <div class="card-panel" @click="handleSetLineChartData('purchases')">
        <div class="card-panel-icon-wrapper icon-money">
          <!-- <svg-icon icon-class="money" class-name="card-panel-icon" /> -->
          <svg t="1638848352250" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="949" width="200" height="200"><path d="M192 109.714h457.142L864.32 288.32a45.704 45.704 0 0 1 13.394 32.32v547.932c0 25.246-20.466 45.714-45.714 45.714H192c-25.248 0-45.714-20.468-45.714-45.714V155.428c0-25.246 20.466-45.714 45.714-45.714z" fill="#FF812D" p-id="950" /><path d="M256 237.714v182.858h73.142v-182.858zM402.286 237.714v182.858h73.142v-182.858zM548.572 237.714v182.858h73.142v-182.858z" fill="#FFFFFF" p-id="951" /></svg>
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">卡总数量</div>
          <count-to
            :start-val="0"
            :end-val="9280"
            :duration="3200"
            class="card-panel-num"
          />
        </div>
      </div>
    </el-col>
    <el-col :xs="6" :sm="6" :md="6" :lg="6" :xl="8" class="card-panel-col" />

    <el-col :xs="6" :sm="6" :md="6" :lg="6" :xl="9" class="card-panel-col">
      <div class="card-panel" @click="handleSetLineChartData('shoppings')">
        <div class="card-panel-icon-wrapper icon-shopping">
          <!-- <svg-icon icon-class="shopping" class-name="card-panel-icon" /> -->
          <svg t="1638848591678" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25802" width="200" height="200"><path d="M508.2112 517.12m-436.2752 0a436.2752 436.2752 0 1 0 872.5504 0 436.2752 436.2752 0 1 0-872.5504 0Z" fill="#FFF7C5" p-id="25803" /><path d="M508.2112 517.12m-340.8384 0a340.8384 340.8384 0 1 0 681.6768 0 340.8384 340.8384 0 1 0-681.6768 0Z" fill="#F9E230" p-id="25804" /><path d="M169.728 556.5952a338.4832 301.4144 0 1 0 676.9664 0 338.4832 301.4144 0 1 0-676.9664 0Z" fill="#F6DB2D" p-id="25805" /><path d="M176.64 596.0192a331.5712 261.9392 0 1 0 663.1424 0 331.5712 261.9392 0 1 0-663.1424 0Z" fill="#F5D228" p-id="25806" /><path d="M188.5184 635.4944a319.6928 222.5152 0 1 0 639.3856 0 319.6928 222.5152 0 1 0-639.3856 0Z" fill="#F2C824" p-id="25807" /><path d="M206.1312 674.9184a302.08 183.04 0 1 0 604.16 0 302.08 183.04 0 1 0-604.16 0Z" fill="#F0BF21" p-id="25808" /><path d="M640.8192 568.9344h-101.5808v-49.408h101.5808c16.9472 0 30.72-13.7728 30.72-30.72s-13.7728-30.72-30.72-30.72H577.536l64.3584-66.5088a30.72 30.72 0 0 0-0.7168-43.4176 30.72 30.72 0 0 0-43.4176 0.7168L508.0064 441.6 415.9488 348.6208a30.68416 30.68416 0 0 0-43.4688-0.2048c-12.032 11.9296-12.1856 31.3856-0.2048 43.4176l65.5872 66.2528H376.2176c-16.9472 0-30.72 13.7728-30.72 30.72s13.7728 30.72 30.72 30.72h101.5808v49.408H376.2176c-16.9472 0-30.72 13.7728-30.72 30.72s13.7728 30.72 30.72 30.72h101.5808v79.6672c0 16.9472 13.7728 30.72 30.72 30.72s30.72-13.7728 30.72-30.72v-79.6672h101.5808c16.9472 0 30.72-13.7728 30.72-30.72 0-16.9984-13.7728-30.72-30.72-30.72z" fill="#FFFFFF" p-id="25809" /></svg>
        </div>
        <div class="card-panel-description">
          <div class="card-panel-text">总资费</div>
          <count-to
            :start-val="0"
            :end-val="13600"
            :duration="3600"
            class="card-panel-num"
          />
        </div>
      </div>
    </el-col>

  </el-row>
</template>

<script>
import CountTo from 'vue-count-to'

export default {
  components: {
    CountTo
  },
  methods: {
    handleSetLineChartData(type) {
      this.$emit('handleSetLineChartData', type)
    }
  }
}
</script>

<style lang="scss" scoped>
.panel-group {
  margin-top: 18px;
  justify-content: center;
  .card-panel-col {
    margin-bottom: 32px;
  }
.icon{
  height: 50px;
  width: 50px;
}
  .card-panel {
    height: 108px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #666;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.05);
    display:flex;
    justify-content: center;

    &:hover {
      .card-panel-icon-wrapper {
        color: #fff;
      }

      .icon-people {
        background: #40c9c6;
      }

      .icon-message {
        background: #36a3f7;
      }

      .icon-money {
        background: #f4516c;
      }

      .icon-shopping {
        background: #34bfa3;
      }
    }

    .icon-people {
      color: #40c9c6;
    }

    .icon-message {
      color: #36a3f7;
    }

    .icon-money {
      color: #f4516c;
    }

    .icon-shopping {
      color: #34bfa3;
    }

    .card-panel-icon-wrapper {
      float: left;
      margin: 14px 0 0 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }

    .card-panel-icon {
      float: left;
      font-size: 48px;
    }

    .card-panel-description {
      float: right;
      font-weight: bold;
      margin: 26px;
      margin-left: 0px;

      .card-panel-text {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 16px;
        margin-bottom: 12px;
      }

      .card-panel-num {
        font-size: 20px;
      }
    }
  }
}

@media (max-width: 550px) {
  .card-panel-description {
    display: none;
  }

  .card-panel-icon-wrapper {
    float: none !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;

    .svg-icon {
      display: block;
      margin: 14px auto !important;
      float: none !important;
    }
  }
}
</style>
